#include<iostream>
using namespace std;

class Phone
{
public:
    Phone(string phone)
    {
        mm_phone = phone;
        cout << "Phone的构造函数调用" << endl;
    }

    ~Phone()
    {
        cout << "Phone的析构函数调用" << endl;
    }

    string mm_phone;
};

class Person
{
public:
    // 隐式转换：m_phone(phone)==Phone m_phone(phone)
    Person(string name,string phone):m_name(name),m_phone(phone)
    {
        cout << "Person的构造函数调用" << endl;
    }

    ~Person()
    {
        cout << "Person的析构函数调用" << endl;
    }

    string m_name;
    Phone m_phone;
};

void test()
{
    Person p("guanxi chen","iphone 15 pro max");

    cout << p.m_name << "手持 " << p.m_phone.mm_phone << endl;
}

int main()
{
    test();

    return 0;
}